package com.ckmike.order_service.utils;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;

/**
 * JsonUtil 简要描述
 * <p> TODO:描述该类职责 </p>
 *
 * @author ckmike
 * @version 1.0
 * @date 18-11-22 下午4:29
 * @copyright ckmike
 **/
public class JsonUtil {

    private static final ObjectMapper objectMapper = new ObjectMapper();

    public static JsonNode str2JsonNode(String jsonstr) {
        try {
            return objectMapper.readTree(jsonstr);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}
